package com.subaiqiao.yunshiyuan.entrance.ysy.mapper;

import com.subaiqiao.yunshiyuan.basis.mapper.BasisMapper;
import com.subaiqiao.yunshiyuan.entrance.ysy.pojo.VerificationCode;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 曹朝禹
 * @since 2022-05-13
 */
@Mapper
public interface VerificationCodeMapper extends BasisMapper<VerificationCode> {
    @Select("SELECT COUNT(*) FROM verification_code")
    Integer FindVerificationCodeCount();

    @Select("SELECT COUNT(*) FROM verification_code WHERE vf_type=0")
    Integer FindSMSVerificationCodeCount();

    @Select("SELECT COUNT(*) FROM verification_code WHERE vf_type=1")
    Integer FindEmailVerificationCodeCount();

    @Select("SELECT COUNT(*) FROM verification_code WHERE TO_DAYS(NOW()) - TO_DAYS(create_datetime)=1")
    Integer FindVerificationYesterdayRegister();
}
